package cn.wolfcode.luowowo.article.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;

@Setter
@Getter
public class TravelQuery extends QueryObject{

    private Long destId = -1L;

    private int dayType = -1;       //旅游天数
    private int travelTimeType = -1;       //旅游月份
    private int perExpendType = -1;       //人均消费

    public int orderType = 1;  //按最新排序

    public String getOrderBy(){
        return orderType == 2? "t.viewnum desc" : "t.createTime desc";
    }
    //开始映射：2 --new TravelCondition(4,7)
    public TravelCondition getDay(){
        return TravelCondition.TRAVEL_DAY.get(dayType);
    }

    //月份
    public TravelCondition getTime(){
        return TravelCondition.TRAVEL_TIME.get(travelTimeType);
    }
    //人均消费
    public TravelCondition getPerExpend(){
        return TravelCondition.TRAVEL_PRE_EXPENDS.get(perExpendType);
    }


}
